<#assign path=request.contextPath>
<#assign basePath=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/">


<!DOCTYPE html>
<html>
<head>
	<title>WebDesign Admin - Assignhomework</title>
    
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	
    <!-- bootstrap -->
    <link href="${path}/css/bootstrap/bootstrap.css" rel="stylesheet" />
    <link href="${path}/css/bootstrap/bootstrap-responsive.css" rel="stylesheet" />
    <link href="${path}/css/bootstrap/bootstrap-overrides.css" type="text/css" rel="stylesheet" />

    <!-- libraries -->
    <link href="${path}/css/lib/bootstrap-wysihtml5.css" type="text/css" rel="stylesheet" />
    <link href="${path}/css/lib/uniform.default.css" type="text/css" rel="stylesheet" />
    <link href="${path}/css/lib/select2.css" type="text/css" rel="stylesheet" />
    <link href="${path}/css/lib/bootstrap.datepicker.css" type="text/css" rel="stylesheet" />
    <link href="${path}/css/lib/font-awesome.css" type="text/css" rel="stylesheet" />

    <!-- global styles -->
    <link rel="stylesheet" type="text/css" href="${path}/css/layout.css" />
    <link rel="stylesheet" type="text/css" href="${path}/css/elements.css" />
    <link rel="stylesheet" type="text/css" href="${path}/css/icons.css" />
    
    <!-- this page specific styles -->
    <link rel="stylesheet" href="${path}/css/compiled/form-showcase.css" type="text/css" media="screen" />

    <!-- open sans font -->
    <link href='http://fonts.useso.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css' />

    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
<body>
    <!-- navbar -->
    <div class="navbar navbar-inverse">
        <div class="navbar-inner">
            <a class="brand" href="index.html"><img src="${path}/img/logo-login.png" /></a>
            			<ul class="nav pull-right">
				<!--无序列表-->
				 <li>
                	<a href="${path}/teacher/selectTerm?terminfo=${termid}">
                   	${username}
                	</a>
            	</li>
				<div class="copyrights"></div>

				<li class="hidden-phone">
                    <a href="${path}/teacher/showRewrite">修改密码</a>
                </li>

                <li class="hidden-phone">
                    <a href="${path}/common/logout">注销</a>
                </li>
			</ul>
		</div>
	</div>
    <!-- end navbar -->

     <!-- sidebar -->

     
	<div id="sidebar-nav">
		<ul id="dashboard-menu">
            <li class="adm">     
              <font size=3><b>
              <#if termname?exists>
              	${termname}
              </#if>
              </b></font>
		    </li>
			<li>
                <a href="${path}/teacher/showTermAndHomework">
                    <i class="icon-home"></i>
                    <span>教师主页</span>
                </a>
            </li>       

             <li class="active">
                <div class="pointer">
                    <div class="arrow"></div>
                    <div class="arrow_border"></div>
                </div>
                <a href="${path}/teacher/assignHomework"> <i
					class="icon-edit"></i> <span>作业发布</span>
				</a>
            </li>
			
			<li><a href="${path}/teacher/TermSum"> <i
					class="icon-signal"></i> <span>作业查看</span>
			</a></li>

			<li><a href="${path}/common/homeworkDisplay"> <i class="icon-picture"></i>
					<span>作业展示</span>
			</a></li>

			<li>
				<a class="dropdown-toggle" href="#"> 
					<i class="icon-group"></i> <span>学生/学年管理</span> 
					<i class="icon-chevron-down"></i>
				</a>
				<ul class="submenu">
					<li><a href="${path}/teacher/terms">新建学年</a></li>
					<li><a href="${path}/teacher/showUsers">密码重置</a></li>
				</ul>
			</li>
	</div>
	<!-- end sidebar -->


	<!-- main container -->
    <div class="content">
        <div class="container-fluid">
            <div id="pad-wrapper" class="form-page">
                <div class="row-fluid form-wrapper">
                    <div class="span8 column">
                        <form action="${path}/teacher/submitHomework" method="post" id="form1">
                            <div class="field-box">
                                <label>题目:</label>
                                <input name="title" id="title" class="span5" type="text" />
                            </div>
                 
                            <div class="field-box">
                                <label>描述:</label>
                                <textarea name="description" class="span9" rows="8"></textarea>
                            </div>
                           
                            <div class="field-box">
                                <label>时间:</label>
                                <input name="starttime" id="starttime" type="text" class="input-large datepicker"/>&nbsp;至&nbsp;
                                <input name="endtime" id="endtime" type="text" class="input-large datepicker" />
                            </div>
                            
                            <div class="field-box">
                                <label>打分方式:</label>
                                <label class="checkbox">
                                    <input name="graded" type="radio" value="0" checked="checked"/> 默认打分
                                </label>
                                <label class="checkbox">
                                    <input name="graded" type="radio" value="1" /> 主观打分
                                </label>
                            </div>
                            <div align="center">
                                <input type="button" class="btn btn-default" value="提交" id="btn"/>
                            </div>
                    	</form>
                	</div>
            	</div>
            </div>
        </div>
    </div>
    <!-- end main container -->

	<!-- scripts for this page -->
    <script src="${path}/js/wysihtml5-0.3.0.js"></script>
    <script src="${path}/js/jquery-latest.js"></script>
    <script src="${path}/js/bootstrap.min.js"></script>
    <script src="${path}/js/bootstrap-wysihtml5-0.0.2.js"></script>
    <script src="${path}/js/bootstrap.datepicker.js"></script>
    <script src="${path}/js/jquery.uniform.min.js"></script>
    <script src="${path}/js/select2.min.js"></script>
    <script src="${path}/js/theme.js"></script>

    <!-- call this page plugins -->
    <script type="text/javascript">
    
        $(function () {

            // add uniform plugin styles to html elements
            $("input:checkbox, input:radio").uniform();

            // select2 plugin for select elements
            $(".select2").select2({
                placeholder: "Select a State"
            });

            // datepicker plugin
            $('.datepicker').datepicker().on('changeDate', function (ev) {
                $(this).datepicker('hide');
            });

            // wysihtml5 plugin on textarea
            $(".wysihtml5").wysihtml5({
                "font-styles": false
            });
        });
        
        $("#btn").click(function(){
        	var title = $("#title").val();
        	var start =  $("#starttime").val();
        	var end =  $("#endtime").val();
        	if(title == ""){
        		alert("请填写题目信息!");
        	}else{
        		if(start >= end){
        			alert("开始时间不能大于等于结束时间");
	        	}else{
	        		form1.submit();
	        	}
        	}
        });
    </script>

</body>
</html>